<template>
    <el-container style="width: 1200px;margin: 0 auto">
      <!--  左  -->
      <el-aside width="200px" style="background-color: black" >
        <h2 style="color: white;text-align: center;margin-bottom: 0">职 行 者</h2>
        <el-menu text-color="#b4b4b4"
                 style="background-color: #020202"
                 default-active="/admin/user" router active-text-color="orange">
          <el-menu-item style="font-size: 20px" index="/recruit/positionManage" @click="changeMenu(0)">
            <el-icon><Management /></el-icon>职位管理
          </el-menu-item>
          <el-menu-item style="font-size: 20px" index="/recommend" @click="changeMenu(1)">
            <el-icon size="25px"><User/></el-icon>牛人推荐
          </el-menu-item>
          <el-menu-item style="font-size: 20px" index="/chatWith" @click="changeMenu(2)">
            <el-icon size="25px"><ChatLineSquare/></el-icon>沟通
          </el-menu-item>
        </el-menu>

      </el-aside>
      <el-container>
      <!--  头  -->
      <el-header style="background-color: white;height: 30px">
        <h1 style="font-size: 20px;margin: 0;color: #020202">{{changem}}
          <span style="float: right;font-size: 20px">
            <a href="/" style="color: #c7c7c7;text-decoration: none">返回首页</a> |
          </span>
        </h1>
      </el-header>
      <!--  右  -->
      <el-main style="background-color: rgba(187,204,213,0.3)">
        <router-view/>
      </el-main>
    </el-container>

    </el-container>
</template>


<script setup>
import {onMounted, ref} from "vue";
import router from "@/router";

const changem = ref('职位管理');
const menu = ref({name:['职位管理','牛人推荐','沟通']});
const changeMenu = (i)=>{
  changem.value= menu.value.name[i];
  console.log(menu.value.name[i]);
}

let user=localStorage.user?JSON.parse(localStorage.user):null;
let Authorization=localStorage.user?JSON.parse(localStorage.Authorization):null;

onMounted(()=>{
  if (user==null){
    alert("请先登录!");
    router.push('/reg');
  }
})
</script>

<style>

</style>